import cv2
import os
from os import path


def mk_video(all_img_path, out_put, fps=24.0):

    size = cv2.imread(all_img_path+'\\1.jpg').shape[0:2]
    videoname = out_put  # 要创建的视频文件名称
    fourcc = cv2.VideoWriter_fourcc('H','2','6','4')  # 编码器
    # 1.要创建的视频文件名称 2.编码器 3.帧率 4.size
    print(fourcc)
    videoWrite = cv2.VideoWriter(videoname, 0x7634706d, fps, size)

    for filename in os.listdir(all_img_path):
        if os.path.isfile(filename):
            img = cv2.imread(filename)
            videoWrite.write(img)

